﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.IO;
using System.Web;
using System.Runtime.CompilerServices;

namespace Hands.UriRewrite
{
    internal static class ConfigStorage
    {
        private static Dictionary<string, UriRootPath> uriRootPathSet = new Dictionary<string, UriRootPath>();

        static ConfigStorage()
        {
            ConfigFileReader.readConfigFile();
        }

        internal static void add(string rootPath, UriRootPath uriRoot)
        {
            if (!uriRootPathSet.ContainsKey(rootPath))
            {
                uriRootPathSet.Add(rootPath, uriRoot);
            }
        }

        internal static UriRootPath find(string uriRootPath)
        {
            if (uriRootPathSet.ContainsKey(uriRootPath))
            {
                return uriRootPathSet[uriRootPath];
            }
            else
            {
                return null;
            }
        }
    }
}
